package Code.Math;

public class MathDemo1 {
    public static void main(String[] args) {

        //adb
        System.out.println(Math.abs(88));
        System.out.println(Math.abs(-88));

        //ceil
        System.out.println(Math.ceil(12.34));
        System.out.println(Math.ceil(12.54));
        System.out.println(Math.ceil(-12.54));
        System.out.println(Math.ceil(-12.34));

        //floor
        System.out.println(Math.floor(12.34));
        System.out.println(Math.floor(12.54));
        System.out.println(Math.floor(-12.54));
        System.out.println(Math.floor(-12.34));

        //round
        System.out.println(Math.round(12.34));
        System.out.println(Math.round(12.54));
        System.out.println(Math.round(-12.54));
        System.out.println(Math.round(-12.34));

        //max or min
        System.out.println(Math.max(20, 30));
        System.out.println(Math.min(20, 30));

        //pow
        System.out.println(Math.pow(2, 3));
        System.out.println(Math.pow(4, 0.25));
        System.out.println(Math.pow(0,-2));
        //开平方根sqrt
        System.out.println(Math.sqrt(4));
        //开立方根cbrt
        System.out.println(Math.cbrt(8));

        //random
        System.out.println(Math.random());


    }
}
